<?php

namespace App\Http\Controllers;

use App\Model\Msg;
use Illuminate\Http\Request;

class MsgController extends Controller
{
    //
    public function index()
    {
        $msgs = Msg::orderBy('status','desc')->orderBy('created_at','desc')->paginate(5);
        return view('msg.index',compact('msgs'));
    }

    public function show(Msg $msg)
    {
        $msg->status = '0';
        $msg->save();
        return view('msg.show',compact('msg'));
    }

}
